﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
//
// Mp3Cleaner, Copyright Mirosław M. Mączka.  All Rights Reserved. This code released under the terms of the Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)
//
namespace Mp3Cleaner
{
    public sealed class LocalizedResource
    {
        public static object Get(string name)
        {
            string[] ss = System.Globalization.CultureInfo.CurrentCulture.TextInfo.CultureName.Split(new[] { '-' });
            object o;
            if (null != (o = Application.Current.TryFindResource((object)(name + "_" + ss[0].ToUpper()))))
            {
                return o;
            }
            return Application.Current.FindResource((object)name);
        }
    }
}
